home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 32 (1993-02)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip / MegaDisc 32 (1993-02)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf / hyperbook / defaulthyperbook (.txt) next >
HyperBook  |  1993-02-11  |  17KB  |  321 lines

  1. "!_h}@
  2. /* */
  3. it = initiator() ; u = left(it,2) ; s = SUBSTR(it,3)
  4. s = s - 5 ; newit = u || s
  5. act = GetVisibility(newit)
  6. do i = 1 to 5
  7.  it =  u || i
  8.  call SetVisibility(it,0)
  9.  call SetVisibility(newit,~(act))
  10.     ShowMenus
  11. /* Secret message from HB_Macros */
  12.    obj = SearchName('7:','SecretMessage')
  13.    if obj ~= '' then call HML_Delete(obj)
  14.    op = open('ar','HB_Macros','r')
  15.    text = ''
  16.    pos = seek('ar',15698)
  17.    do i = 1 to 7
  18.     t = readln('ar')
  19.     t = substr(t,13,40)
  20.     text = text || t || '0a'x
  21.    end
  22.    cl = close('ar')
  23.    note = createnote()
  24.    call scaletosize(note, 350, 90)
  25.    call setposition(note,  120, 60)
  26.    call setname(note, 'SecretMessage')
  27.    note =  relocate(note, ':')
  28.    call InsertText(note,text,0)
  29. SecretMessage
  30. /* File info */
  31.  ob = SearchName('4:','ArtInfo')
  32.  if ob ~= '' then call HML_Delete(ob)
  33.  fn = 'HB_Macros'
  34.  actif = show('L','rexxsupport.library')
  35.  if actif = 0 then do
  36.    loadit = addlib('rexxsupport.library',0,-30,0)
  37.    actif = show('L','rexxsupport.library')
  38.    end
  39.  if actif = 1 then do
  40.    t = "ARexx 'statef()' being used : " || '0a'x || '0a'x
  41.    parse value statef(fn) with type size blk bits
  42.    t = t || '  Name           : ' || fn || '0a'x
  43.    t = t || '  Type of object : ' || type || '0a'x
  44.    t = t || '  Size in bytes  : ' || size || '0a'x
  45.    t = t || '  Size in blocks : ' || blk
  46.    x = 140 ; y = 90 ; w = 300 ; h = 80
  47.    end
  48.  else do
  49.    t = "DOS 'list' being used : " || '0a'x
  50.    address command 'list >ram:temp HB_macros'
  51.    t = t || '0a'x || LoadText('ram:temp')
  52.    x = 40 ; y = 110 ; w = 520 ; h = 50
  53.    end
  54.    n = createnote()
  55.    call inserttext(n, t, 0)
  56.    call scaletosize(n, w, h)
  57.    call setposition(n,  x, y)
  58.    call setname(n, 'ArtInfo')
  59.    call relocate(n, ':')
  60. FileInfo
  61. /* List jobs */
  62. it=right(initiator(),1)
  63.  select
  64.   when it=1 then call inform("You just clicked on" || '0a'x || "the black heading" || '0a'x || "in the list.")
  65.   when it=2 then do
  66.     ar=SearchName('2:','Note1') ; str=ReadNoteText(ar,0,1) ; oldt=DeleteText(ar,0,-1)
  67.     if str='T' then newt='New text has been put in the Note'
  68.     else newt='This is an example of a HyperText Note'
  69.     call InsertText(ar,newt,0)
  70.    end
  71.   when it=3 then do
  72.     ar=SearchName('2:','Button1') ; left=GetLeft(ar) ; top=GetTop(ar)
  73.     if left<400 then call SetPosition(ar,left+100,top)
  74.     else call SetPosition(ar,left-100,top)
  75.    end
  76.   when it=4 then do
  77.     ar=SearchName('2:','Drawing1') ; w=GetWidth(ar) ; h=GetHeight(ar)
  78.     if w<120 then call Scale(ar,150)
  79.     else call Scale(ar,67)
  80.    end
  81.   when it=5 then do
  82.     ar=SearchName('2:','PicFrame') ; sh=ShadowStyle(ar,0)
  83.     if sh=1 then do
  84.       call SetBorder(ar,5) ; call SetShadow(ar,3) ; call ShadowStyle(ar,2)
  85.       end
  86.       else do ; call SetShadow(ar,1) ; call ShadowStyle(ar,1) ; end
  87.    end
  88.   when it=6 then do
  89.     ar=SearchName('2:','List1') ; a=' I change my own wording' ; b=' This is a new wording'
  90.     t=GetItemText(ar || '/6')
  91.     if t=a then oldt=SetItemText(ar || '/6',b)
  92.     else oldt=SetItemText(ar || '/6',a)
  93.     end
  94. ListJobs
  95. /*  Table into List */
  96.  arg = SearchName('6:','Table')
  97.  if arg ~= '' then call HML_Delete(arg)
  98.  op = open('ta','HB_Macros','r')
  99.  se = seek('ta',4401)
  100.  li = createlist()
  101.  do i = 1 to 7
  102.   t = readln('ta')
  103.    t1 = substr(t,12,19) ; it = appenditem(li, t1, 1)
  104.    if i = 7 then leave
  105.    t1 = substr(t,35,22) ; it = appenditem(li, t1, 1)
  106.    t1 = substr(t,60,20) ; it = appenditem(li, t1, 1)
  107.   end
  108.  cl = close('ta')
  109.  call scaletosize(li, 200, 180)
  110.  call setposition(li,  300, 10)
  111.  call setname(li, 'Table')
  112.  li =  relocate(li, ':')
  113. Table
  114. /* Subtitles from article */
  115. call BeginPrompt("Hang on ...")
  116. obj = SearchName('5:','SubHeadings')
  117. if obj ~= '' then call HML_Delete(obj)
  118. com = 'search >ram:tmp HB_Macros [43m NONUM'
  119. address command com
  120. if open(fr, 'ram:tmp', 'r') then do
  121.    list = createlist()
  122.    do forever
  123.       lin = readln(fr)
  124.        if length(lin) > 10 then do
  125.         part = substr(lin,11,length(lin) - 16)
  126.        end
  127.       if eof(fr) then leave
  128.       item = appenditem(list, part, 1)
  129.       end
  130.    call close(fr)
  131.    call scaletosize(list, 350, 136)
  132.    call setposition(list,  20, 60)
  133.    call setname(list, 'Subheadings')
  134.    list =  relocate(list, ':')
  135.   obj = SearchName('5:','Bytes')
  136.   num = NumElements(obj)
  137.   do i = 1 to num
  138.    item = obj || '/' || i ; title = list || '/' || i
  139.    text = GetItemText(item) ;  gap = index(text," ")
  140.    start = left(text,gap-1)
  141.    amt = right(text,length(text) - gap)
  142.    cmd = 'call ShowTextRange("HB_Macros",' || start || ',' || amt || ')'
  143.    call SetActionRexx(title, cmd)
  144.    end
  145.    title = list || '/' || 6
  146.    cmd = "call Inform('Click on either of the next two items.')"
  147.    call SetActionRexx(title, cmd)
  148.    title = list || '/' || 9
  149.    cmd = "call Inform('Click on any of the next five items.')"
  150.    call SetActionRexx(title, cmd)
  151.    end
  152. SubHeadings
  153. "TitleNote"
  154. An article about HyperBook,
  155. and some related demos
  156. "TwoNotes"
  157. Without ARexx
  158.  you will be able to 
  159.  the demo pages,
  160. but not run them. If you try, you'll get an 'ARexx
  161. unavailable' message. Read the article
  162. anyway!
  163. With ARexx
  164. , running the demos will change the unit. 
  165. If you then save, reload, and run it, most of the 
  166. demos will have lost their point. Think before you save!
  167. Click here when you've read this
  168.     "Symbols"
  169. 1 2 3 4 5 6
  170. Navigation symbols
  171.  Go to previous page
  172.  Next page
  173.  First page
  174.  Last page
  175.  Page you came from 
  176.  Any page 
  177. Demos  
  178. On pages 2 - 7
  179. To Quit 
  180. Use the Menu
  181. To hide this note
  182.           Click here 
  183. "NoteOnARexx"
  184. Click here for two
  185. important notes 
  186. "Navigation"
  187.  Click here for 
  188.    navigation advice
  189.     "ReadArt"
  190.  :c/fullview :hyperbook/HB_Macros
  191. Click here to 
  192.  see the article
  193. Page1
  194. Button1
  195. /say "The Button's object number is" initiator()
  196. A Button
  197. Note1
  198. 4call inform("You just clicked on the Note example.")
  199. This is an example
  200. of a HyperText Note
  201.     "Script2"
  202. Each item in this list has been given an 'action'.
  203. List1
  204. #We are a list. Click on any of us :
  205. ! I change the wording of the Note
  206. $ I change the position of the Button
  207. ! I change the size of the Drawing
  208. # I change the shadow of the Picture
  209.  I change my own wording
  210. Drawing1
  211. call inform("This drawing is at " || GetLeft(initiator()) || '0a'x || "pixels from the left" || '0a'x || "and" GetTop(initiator()) "from the top.")
  212.     "Script1"
  213. Five types of 'object' :
  214. Each of these objects has been given an
  215.  'action'
  216. "PicFrame"
  217. call Inform('This frame is ' || GetWidth(initiator()) || ' pixels wide,' || '0a'x || 'and it is ' || GetHeight(initiator()) || ' pixels high')
  218. Picture1
  219. call Inform("This picture is " || GetWidth(initiator()) || ' pixels wide,' || '0a'x || 'and it is ' || GetHeight(initiator()) || ' pixels high')
  220.     Ram Disk:
  221. Picture
  222. Page2
  223. "Note6"
  224. Default
  225. Empty bin
  226. Print page
  227. Print text
  228. Tiny window
  229. About
  230. "Note7"
  231. Create page
  232. Delete page
  233. Edit page
  234. Load page
  235. Save page
  236. Merge page
  237. Master page
  238. Show page links
  239. "Note8"
  240. Find object
  241. Find text
  242. Find page
  243. Find again
  244. Read a text file
  245. Edit a text file
  246. Display a picture
  247. Delete a file
  248. Run word processor
  249. Run paint program
  250. "Note9"
  251.   Display coordinates
  252.   Interlace text
  253.   Main control panel 
  254.   Hide title bar
  255.   Buttons
  256.   Edit invisible objects
  257.   Save icons
  258.   Save backup files
  259.   Workbench
  260. Edit default object
  261. Select word processor
  262. Select paint program
  263. "Note10"
  264. Run macro
  265. Run command
  266. Create macro
  267. Delete macro
  268. Edit macro
  269. Load macro
  270. Save macro
  271. "Note1"
  272. Project
  273. "Note2"
  274. "Note3"
  275. Commands
  276. "Note4"
  277. Preferences
  278. "Note5"
  279. ARexx
  280. "Script"
  281. This is a look-alike of the full HyperBook menu.
  282. It doesn't work, of course.
  283. A click on any of the red headings toggles its own
  284. list on/off, and turns 'off' any other 'on' list.
  285. None of the sub-items are shown here.
  286. Page3
  287. Note1
  288. Click here to obtain information
  289. about the file containing the article
  290. Page4
  291. "ClickHere"
  292. Click here to create a list of article subheadings,
  293. and then on any item in the list to read the patch.
  294. "Bytes"
  295. 355 562
  296. 917 764
  297.     1681 1482
  298.     3163 2746
  299.     5909 3042
  300. 8951 40
  301. 8991 801
  302. 9792 314
  303. 10106 41
  304.     10147 868
  305. 11015 1091
  306. 12106 2078
  307. 14184 1174
  308. 15358 1074
  309. Page5
  310. "Script"
  311. To read a table from the
  312. article and reformat it
  313. as a HyperBook List
  314. "ClickHere"
  315. Click here
  316. Page6
  317. "ClickHere"
  318.   Click here to see the hidden message
  319. Page7
  320. garnet.font
  321.